/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef STATION_CONTROLLER_H
#define STATION_CONTROLLER_H

#include "base_thing_model.h"
#include "sle_thing_model_define.h"
#include "cJSON.h"

namespace OHOS {
namespace iotConnect {
class StationController : public AbstractDevice {
public:
    std::string GenerateUniqueMsgSeq() const;
    cJSON *IotcCharStateToJson(const IotcCharState *state) const;
    virtual int32_t DevInfoGetCharState(const IotcCharState inData, std::string *data, uint32_t *len) const override;
    virtual int32_t ConfigurationManagementGetCharState(
        const IotcCharState inData, std::string *data, uint32_t *len) override;
    virtual int32_t ConfigurationManagementPutCharState(
        const IotcCharState inData, const char *data, uint32_t len) override;
    virtual int32_t InternalHandler(
        const IotcCharState inData, std::string &out, ThingModelPutOrGet flag = ThingModelPutOrGet::GET) override;
    virtual int32_t GetAllInfoHandler(const std::string &devId, IotcCharState *state) override;
    static int32_t GetSleBaseDeviceInfo(SleBaseDeviceInfo &devInfo);
    int32_t GetSn(std::string *data, uint32_t *len);

private:
    static SleBaseDeviceInfo sleBaseDeviceInfo_;
    static SleBaseWiFiInfo sleBaseWiFiInfo_;
    static SleBaseSleInfo sleBaseSleInfo_;
    static ConfigurationManagementInfo configurationManagementInfo_;
    static SleBaseCPUInfo sleBaseCPUInfo_;
    static SleBaseOSInfo sleBaseOSInfo_;
    static SleBaseOTAInfo sleBaseOTAInfo_;
    static SleBaseRestartInfo sleBaseRestartInfo_;
    static SleBaseFactoryReset sleBaseFactoryReset_;

    const std::string JSON_STR_SNW {"snw"};
};
} // namespace iotConnect
} // namespace OHOS
#endif
